package dk.hojlind.hackhunt.control;

import dk.hojlind.hackhunt.model.Machine;
import dk.hojlind.hackhunt.model.Observer;
import dk.hojlind.hackhunt.model.Subject;

public class MachineHandler extends Handler implements Observer{
	
	//Private variables
	Machine machine;
	
	//calls
	String scanCode = "scanService";
	String exploitCode = "exploitService";
	String patchCode = "patchService";
	
	public MachineHandler(String address, int port, Subject serverService, Machine machine)
	{
		super(address, port);
		this.machine = machine;
	}
	
	public MachineHandler()
	{
		
	}
	

	//Methods for getting services and exploiting and sending answers.
	//Methods for incoming stuff
	public void listServices()
	{
		
	}
	
	public void listPatches()
	{
		
	}
	
	public void listExploits()
	{
		
	}
	
	//Methods for outgoing stuff
	public void scanningForServices(String target)
	{
		
	}
	
	public void getExploits(String service)
	{
		
	}
	
	
	
	@Override
	public void update(String message) {
		
		if(message.contains(scanCode))
		{
			listServices();
		}
		
		if(message.contains(patchCode))
		{
			listPatches();
		}
		
		if(message.contains(exploitCode))
		{
			listExploits();
		}
		
	}

}
